//
// Created by liu on 2019/10/5.
//

#ifndef DESIGNPATTERNS_ABSTRACTORYFACTORY_H
#define DESIGNPATTERNS_ABSTRACTORYFACTORY_H

//抽象工厂模式
# include <iostream>

class Mouth{
public:
    virtual void Say() = 0;
};

class KeyBord{
public:
    virtual void Say() = 0;
};

class ComFactory{
public:
    virtual Mouth* CreateMouth() = 0;
    virtual KeyBord* CreateKeyBord() = 0;
};

class HPMouth : public Mouth{
public:
    void Say();
};

class DellMouth : public Mouth{
public:
    void Say();
};

class HPKeyBord : public KeyBord{
public:
    void Say();
};

class DellKeyBord : public KeyBord{
public:
    void Say();
};

class HPFactory : public ComFactory{
public:
    Mouth* CreateMouth();
    KeyBord* CreateKeyBord();
};

class DellFactory : public ComFactory{
public:
    Mouth* CreateMouth();
    KeyBord* CreateKeyBord();
};

#endif //DESIGNPATTERNS_ABSTRACTORYFACTORY_H
